package com.birdy.redis.code;

/**
 * @author birdy
 * @date 2022/4/11 8:49 AM
 */
public enum RedisSettingCode {

    STATUS_NOT_START("status", "0"),
    STATUS_START("status", "1"),
    STATUS_END("status", "-1"),
    RUSH_USER_DISABLED("rush_user", "0"),
    RUSH_USER_ENABLED("rush_user", "1"),
    TIMER_DISABLED("timer", "0"),
    TIMER_ENABLED("timer", "1"),
    USER_NUM("user_num", "0"),
    VOTE_DISABLED("vote", "0"),
    VOTE_ENABLE("vote", "1"),
    ROOM_PREFIX("room-", ""),
    USER_PREFIX("user-", ""),
    CARD_PREFIX("c-", ""),
    SETTING_PREFIX("s-", "");

    private String key;
    private String value;
    private RedisSettingCode(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {  // 直接将数据以JSON的形式返回
        return "{\"key\":" + this.key + ",\"value\":" + this.value + "}";
    }
}
